import request from '@/utils/request'
export default {
  create: params => {
    return request({
      url: `/syscode/create`,
      method: 'post',
      data: params
    })
  },

  // 查询系统编码列表（根据父ID）
  getList: params => {
    return request({
      url: `/syscode/list`,
      method: 'get',
      params: params
    })
  },

  // 查询系统编码详情（根据ID）
  getDatail: id => {
    return request({
      url: `/syscode/detail/${id}`,
      method: 'get'
    })
  },

  // 查询公共编码列表（根据类别编码）
  getListByCode: params => {
    return request({
      url: `/syscode/listbyvalue`,
      method: 'get',
      params: params
    })
  },
  update: params => {
    return request({
      url: `/syscode/update`,
      method: 'put',
      data: params
    })
  },
  cancelAll: params => {
    return request({
      url: `/syscode/cancelAll`,
      method: 'put',
      params
    })
  },

  delete: params => {
    return request({
      url: `/syscode/delete`,
      method: 'delete',
      params: params
    })
  }
}
